home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / C / Games / NetHack 3.1.3 / source / doc / dgn_comp.6 next >
Encoding:
Text File  |  1993-08-01  |  6.8 KB  |  393 lines  |  [TEXT/R*ch]

  1. .TH DGN_COMP 6 "1 May 1992"
  2. .UC 4
  3. .SH NAME
  4. dgn_comp \- NetHack dungeon compiler
  5. .SH SYNOPSIS
  6. .B dgn_comp
  7. [
  8. .I file
  9. ]
  10. .PP
  11. If no arguments are given, it reads standard input.
  12. .SH DESCRIPTION
  13. .PP
  14. .I Dgn_comp
  15. is a dungeon compiler for NetHack version 3.1 and higher.  It
  16. takes a description file as an argument and produces a dungeon "script" 
  17. that is to be loaded by NetHack at runtime.
  18. .PP
  19. The purpose of this tool is to provide NetHack administrators and
  20. implementors with a convenient way to create a custom dungeon for the
  21. game, without having to recompile the entire world.
  22. .SH GRAMMAR
  23. .PP
  24. DUNGEON: 
  25. .B name
  26. .B bonesmarker
  27. (
  28. .B base
  29. ,
  30. .B rand
  31. ) [
  32. .B %age
  33. ]
  34. .PP
  35. where
  36. .B name
  37. is the dungeon name,
  38. .B bonesmarker
  39. is a letter for marking bones files, (
  40. .B base
  41. .B rand
  42. ) is the number of levels, and
  43. .B %age
  44. is its percentage chance of being generated (if absent, 100% chance).
  45.  
  46. DESCRIPTION:
  47. .B tag
  48. .PP
  49. where
  50. .B tag
  51. is currently one of
  52. .BR HELLISH ,
  53. .BR MAZELIKE ,
  54. or
  55. .BR ROGUELIKE .
  56.  
  57. ALIGNMENT | LEVALIGN: [
  58. .B lawful
  59. |
  60. .B neutral
  61. |
  62. .B chaotic
  63. |
  64. .B unaligned
  65. ]
  66. .PP
  67. gives the alignment of the dungeon/level (default is unaligned).
  68.  
  69. ENTRY:
  70. .B level
  71. .PP
  72. the dungeon entry point.  The dungeon connection attaches at this
  73. level of the given dungeon.
  74. If the value of
  75. .B level
  76. is negative, the entry level is calculated from the bottom of the
  77. dungeon, with -1 being the last level.
  78. If this line is not present in a dungeon description, the entry level
  79. defaults to 1.
  80.  
  81. PROTOFILE:
  82. .B name
  83. .PP
  84. the prototypical name for dungeon level files in this dungeon.
  85. For example, the PROTOFILE name for the dungeon
  86. .I Vlad's Tower
  87. is
  88. .IR tower .
  89.  
  90. LEVEL:
  91. .B name
  92. .B bonesmarker
  93. @ (
  94. .B base
  95. ,
  96. .B rand
  97. ) [
  98. .B %age
  99. ]
  100. .PP
  101. where
  102. .B name
  103. is the level name,
  104. .B bonesmarker
  105. is a letter for marking bones files, (
  106. .B base
  107. .B rand
  108. ) is the location and
  109. .B %age
  110. is the generation percentage, as above.
  111.  
  112. RNDLEVEL:
  113. .B name
  114. .B bonesmarker
  115. @ (
  116. .B base
  117. ,
  118. .B rand
  119. )
  120. [
  121. .B %age
  122. ]
  123. .B rndlevs
  124. .PP
  125. where
  126. .B name
  127. is the level name,
  128. .B bonesmarker
  129. is a letter for marking bones files, (
  130. .B base
  131. .B rand
  132. ) is the location,
  133. .B %age
  134. is the generation percentage, as above, and
  135. .B rndlevs
  136. is the number of similar levels available to choose from.
  137.  
  138. CHAINLEVEL:
  139. .B name
  140. .B bonesmarker
  141. .B prev_name
  142. + (
  143. .B base
  144. ,
  145. .B rand
  146. ) [
  147. .B %age
  148. ]
  149. .PP
  150. where
  151. .B name
  152. is the level name,
  153. .B bonesmarker
  154. is a letter for marking bones files,
  155. .B prev_name
  156. is the name of a level defined previously, (
  157. .B base
  158. ,
  159. .B rand
  160. ) is the
  161. .I offset
  162. from the level being chained from, and
  163. .B %age
  164. is the generation percentage.
  165.  
  166. RNDCHAINLEVEL:
  167. .B name
  168. .B bonesmarker
  169. .B prev_name
  170. + (
  171. .B base
  172. ,
  173. .B rand
  174. ) [
  175. .B %age
  176. ]
  177. .B rndlevs
  178. .PP
  179. where
  180. .B name
  181. is the level name,
  182. .B bonesmarker
  183. is a letter for marking bones files,
  184. .B prev_name
  185. is the name of a level defined previously, (
  186. .B base
  187. ,
  188. .B rand
  189. ) is the
  190. .I offset
  191. from the level being chained from,
  192. .B %age
  193. is the generation percentage, and
  194. .B rndlevs
  195. is the number of similar levels available to choose from.
  196.  
  197. BRANCH:
  198. .B name
  199. @ (
  200. .B base
  201. ,
  202. .B rand
  203. ) [
  204. .B stair
  205. |
  206. .B no_up
  207. |
  208. .B no_down
  209. |
  210. .B portal
  211. ] [
  212. .B up
  213. |
  214. .B down
  215. ]
  216. .PP
  217. where
  218. .B name
  219. is the name of the dungeon to branch to, and (
  220. .B base
  221. ,
  222. .B rand
  223. ) is the location of the branch.
  224. The last two optional arguments are
  225. the branch type and branch direction.
  226. The type of a branch can be a two-way stair connection,
  227. a one-way stair connection, or a magic portal.
  228. A one-way stair is described by the types
  229. .B no_up
  230. and
  231. .B no_down
  232. which specify which stair direction is missing.
  233. The default branch type is
  234. .BR stair .
  235. The direction for a stair can be either up or down; direction is not
  236. applicable to portals.  The default direction is
  237. .BR down .
  238.  
  239. CHAINBRANCH:
  240. .B name
  241. .B prev_name
  242. + (
  243. .B base
  244. ,
  245. .B rand
  246. ) [
  247. .B stair
  248. |
  249. .B no_up
  250. |
  251. .B no_down
  252. |
  253. .B portal
  254. ] [
  255. .B up
  256. |
  257. .B down
  258. ]
  259. .PP
  260. where
  261. .B name
  262. is the name of the dungeon to branch to,
  263. .B prev_name
  264. is the name of a previously defined
  265. .B level
  266. and (
  267. .B base
  268. ,
  269. .B rand
  270. ) is the
  271. .I offset
  272. from the level being chained from.
  273. The optional branch type and direction are the same as described above.
  274. .SH GENERIC RULES
  275. .PP
  276. Each dungeon must have a unique
  277. .B bonesmarker ,
  278. and each special level must have a
  279. .B bonesmarker
  280. unique within its dungeon (letters may be reused in different dungeons).
  281. If the
  282. .B bonesmarker
  283. has the special value "none", no bones files will be created for that
  284. level or dungeon.
  285. .PP
  286. The value
  287. .B base
  288. may be in the range of 1 to
  289. .B MAXLEVEL
  290. (as defined in
  291. .I global.h
  292. ).
  293. .PP
  294. The value
  295. .B rand
  296. may be in the range of -1 to
  297. .BR MAXLEVEL .
  298. .PP
  299. If
  300. .B rand
  301. is -1 it will be replaced with the value (num_dunlevs(dungeon) - base)
  302. during the load process (ie. from here to the end of the dungeon).
  303. .PP
  304. If
  305. .B rand
  306. is 0 the level is located absolutely at
  307. .BR base .
  308. .PP
  309. Branches don't have a probability.  Dungeons do.  If a dungeon fails
  310. to be generated during load, all its levels and branches are skipped.
  311. .PP
  312. No level or branch may be chained from a level with a percentage generation
  313. probability.  This is to prevent non-resolution during the load.
  314. In addition, no branch may be made from a dungeon with a percentage
  315. generation probability for the same reason.
  316. .PP
  317. As a general rule using the dungeon compiler:
  318. .PP
  319. If a dungeon has a
  320. .B protofile
  321. name associated with it
  322. .RI ( eg.
  323. .BR tower )
  324. that file will be used.
  325. .PP
  326. If a special level is present, it will override the above rule and
  327. the appropriate file will be loaded.
  328. .PP
  329. If neither of the above are present, the standard generator will
  330. take over and make a "normal" level.
  331. .PP
  332. A level alignment, if present, will override
  333. the alignment of the dungeon that it exists within.
  334. .SH EXAMPLE
  335. .PP
  336. Here is the current syntax of the dungeon compiler's "language":
  337.  
  338. .LP
  339. .nf
  340. .ta +8n +8n +8n
  341. #
  342. #    The dungeon description file for the "standard" original
  343. #    3.0 NetHack.
  344. #
  345. DUNGEON:    "The Dungeons of Doom" "D" (25, 5)
  346. LEVEL:        "rogue" "none" @ (15, 4)
  347. LEVEL:        "oracle" "none" @ (5, 7)
  348. LEVEL:        "bigroom" "B" @ (12, 3) 15
  349. LEVEL:        "medusa" "none" @ (20, 5)
  350. CHAINLEVEL:    "castle" "medusa" + (1, 4)
  351. CHAINBRANCH:    "Hell" "castle" + (0, 0) no_down
  352. BRANCH:        "The Astral Plane" @ (1, 0) no_down up
  353.  
  354. DUNGEON:    "Hell" "H" (25, 5)
  355. DESCRIPTION:    mazelike
  356. DESCRIPTION:    hellish
  357. BRANCH:        "Vlad's Tower" @ (13, 5) up
  358. LEVEL:        "wizard" "none" @ (15, 10)
  359. LEVEL:        "fakewiz" "A" @ (5, 5)
  360. LEVEL:        "fakewiz" "B" @ (10, 5)
  361. LEVEL:        "fakewiz" "C" @ (15, 5)
  362. LEVEL:        "fakewiz" "D" @ (20, 5)
  363. LEVEL:        "fakewiz" "E" @ (25, 5)
  364.  
  365. DUNGEON:    "Vlad's Tower" "T" (3, 0)
  366. PROTOFILE:    "tower"
  367. DESCRIPTION:    mazelike
  368. ENTRY:        -1
  369.  
  370. DUNGEON:    "The Astral Plane" "A" (1, 0)
  371. DESCRIPTION:    mazelike
  372. PROTOFILE:    "endgame"
  373. .fi
  374. .PP
  375. .I NOTES:
  376. .br
  377. Lines beginning with '#' are considered comments.
  378. .br
  379. A special level must be explicitly aligned.  The alignment of the dungeon
  380. it is in only applies to non-special levels within that dungeon.
  381. .SH AUTHOR
  382. .PP
  383. M. Stephenson (from the level compiler by Jean-Christophe Collet).
  384. .SH "SEE ALSO"
  385. .PP
  386. lev_comp(6), nethack(6)
  387. .SH BUGS
  388. .PP
  389. Probably infinite.
  390.